<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .outer {
        width: 50px;
        height: 50px;
        display: flex;
        /* align-items: center; */
        align-items: safe center; /* 使用save 解决冲突*/
        justify-content: center;
        overflow-y: auto;
        background-color: antiquewhite;
      }
      .inner {
        width: 20px;
        height: 100px;
        background-color: aqua; /* margin: auto; */ /* margin: 10px auto; */
      }
    </style>
    <link rel="stylesheet" href="test.css" />
  </head>
  <body>
    <div class="outer"><div class="inner">12</div></div>
    <script></script>
  </body>
</html>

<!-- 参考博客 https://blog.csdn.net/lihaogn/article/details/140008339?spm=1001.2014.3001.5501-->
